<template>
    <div>Test</div>
    <a-button block type="primary" @click="reset">恢复出厂设置</a-button><br />
    <a-button block danger @click="deleteSchedule">删除行程</a-button><br />
    <a-button block @click="open">开</a-button><br />
    <a-button block @click="close">关</a-button><br />
    <a-button block @click="stop">停止</a-button><br />
    <a-button block @click="set1">设置行程点1</a-button><br />
    <a-button block @click="set2">设置行程点2</a-button><br />

    <a-button block @click="open1">打开行程点1</a-button><br />
    <a-button block @click="open2">打开行程点2</a-button><br />
    <a-button block @click="percent">0%(关闭)</a-button><br />
    <a-button block @click="percent100">100%（打开）</a-button><br />

    <a-button block type="primary" @click="readRoad">读行程点</a-button><br />
    <a-button block type="primary" @click="readLocation">读位置</a-button><br />
</template>
<script setup lang="ts">

const reset = () => {
    window.ClosetAndroid.reset();
}
const deleteSchedule = () => {
    window.ClosetAndroid.deleteSchedule();
}

const open = () => {
    window.ClosetAndroid.openTrackLock();
}
const close = () => {
    window.ClosetAndroid.closeTrackLock();
}
const stop = () => {
    window.ClosetAndroid.stopTrackLock();
}
const percent = () => {
    window.ClosetAndroid.setTrackLockPercent(0);
}
const percent100 = () => {
    window.ClosetAndroid.setTrackLockPercent(100);
}

const readLocation = () => {
    window.ClosetAndroid.readTrackLockLocation();
}

const set1 = () => {
    window.ClosetAndroid.setRoad(1);
}
const set2 = () => {
    window.ClosetAndroid.setRoad(2);
}
const open1 = () => {
    window.ClosetAndroid.openRoad(1);
}
const open2 = () => {
    window.ClosetAndroid.openRoad(1);
}

const readRoad = () => {
    window.ClosetAndroid.readRoad();
}
</script>
<style lang="scss" scoped>
.ant-btn {
    margin: 10px;
    font-size: .5rem;
    height: auto;
}
</style>